
#include <iostream>
//#include <Windows.h>
//#include <unistd.h>
#include "newserver.h"
#include "ai.h"
#include "parser.h"

//#include "gameboard.h"


using namespace std;

int main()
{
	server powell_reversii;
	powell_reversii.create_server();
	string input;
	char welcome_msg[BUFSIZ];
	
	parser play;
	play.setupboard();
	// strcpy(welcome_msg,"Reversi\n\n\r");
	powell_reversii.server_send("\n\tABHAY'S AWESOME REVERSII\n\n");
	//strcpy(welcome_msg,"Welcome to Single Client Telnet Server Demo\n\r");
	powell_reversii.server_send("The following commands are acceptable\n");
	powell_reversii.server_send("EXIT | DISPLAY_ON | DISPLAY_OFF | EASY | MEDIUM | HARD|\n");
	powell_reversii.server_send("BLACK | WHITE | UNDO | REDO | SHOW_NEXT_POS\n\n");
	powell_reversii.server_send("Make a move by typing \"move\" followed by row and column.\n");
	powell_reversii.server_send("Example: move 3e \n");
	powell_reversii.server_send("EXIT closes the program\n");
	powell_reversii.server_send("Enter the level of the AI, This can be changed at anytime\n");
	
	input = powell_reversii.server_recv();
	if(input=="easy"||input=="EASY"||input=="medium"||input=="MEDIUM"||input=="hard"||input=="HARD")
		play.expr(input);


	play.displayer();

	powell_reversii.server_send("\nEnter the color you wish to play as, black goes first\n");
	input = powell_reversii.server_recv();
	if(input=="white"||input=="WHITE"||input=="black"||input=="BLACK")
	{
		play.expr(input);
	}
	powell_reversii.server_send("HAVE FUN!!!!\n");
	//play.displayer();

	while(true)
	{
		input = powell_reversii.server_recv();
		play.expr(input);
		
	}
	
	return(0);
}
